#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int a,b;
	int maxn=0;
	vector<int> ret;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		int t=i;
		int cnt=0;
		while(t>10)
		{
			int s=1;
			while(t)
			{
				s*=t%10;
				t/=10;
			}
			t=s;
			cnt++;
		}
		if(cnt>maxn)
		{
			ret.clear();
			maxn=cnt;
			ret.push_back(i);
		}
		else if(cnt==maxn)
		{
			ret.push_back(i);
		}
	}
	cout<<maxn<<endl;
	for(int i=0;i<ret.size();i++)
	{
		if(!i)
			cout<<ret[i];
		else
			cout<<' '<<ret[i];
	}
	return 0;
}
